<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: ailayer_reshape.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('ailayer__reshape_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">ailayer_reshape.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="ailayer__reshape_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#ifndef AILAYER_RESHAPE_H</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define AILAYER_RESHAPE_H</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="aifes__core_8h.html">core/aifes_core.h</a>&quot;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structailayer__reshape.html">ailayer_reshape</a>  <a class="code" href="structailayer__reshape.html">ailayer_reshape_t</a>;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structailayer__flatten.html">ailayer_flatten</a>  <a class="code" href="structailayer__flatten.html">ailayer_flatten_t</a>;</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="structailayer__reshape.html">   42</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structailayer__reshape.html">ailayer_reshape</a> {</div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="structailayer__reshape.html#ab13782a46e3804246bf82a92955096b3">   43</a></span>&#160;    <a class="code" href="structailayer.html">ailayer_t</a> <a class="code" href="structailayer__reshape.html#ab13782a46e3804246bf82a92955096b3">base</a>; </div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="structailayer__reshape.html#a9a409c01151b26b02e9529cc3e9bad4a">   51</a></span>&#160;    uint8_t <a class="code" href="structailayer__reshape.html#a9a409c01151b26b02e9529cc3e9bad4a">output_dim</a>; </div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structailayer__reshape.html#a272c55c5384efcdef56c4a0d2f402f5f">   52</a></span>&#160;    uint8_t <a class="code" href="structailayer__reshape.html#a272c55c5384efcdef56c4a0d2f402f5f">infer_axis</a>; </div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="structailayer__reshape.html#ad3f93dd235b148208b067167c3ec0722">   53</a></span>&#160;    uint16_t *<a class="code" href="structailayer__reshape.html#ad3f93dd235b148208b067167c3ec0722">output_shape</a>; </div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="structailayer__reshape.html#a9a1746c92a713417bac8ab78ee640532">   69</a></span>&#160;    void (*<a class="code" href="structailayer__reshape.html#a9a1746c92a713417bac8ab78ee640532">reshape</a>)(<span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *x, <a class="code" href="structaitensor.html">aitensor_t</a> *result);</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;};</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="structailayer__flatten.html">   78</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structailayer__flatten.html">ailayer_flatten</a> {</div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="structailayer__flatten.html#abe8035011f4a1c3aacdc504dd4bef9f5">   79</a></span>&#160;    <a class="code" href="structailayer__reshape.html">ailayer_reshape_t</a> <a class="code" href="structailayer__flatten.html#abe8035011f4a1c3aacdc504dd4bef9f5">base</a>; </div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="structailayer__flatten.html#ac1131c176885226411465ea77bd4b92d">   81</a></span>&#160;    uint16_t <a class="code" href="structailayer__flatten.html#ac1131c176885226411465ea77bd4b92d">output_shape</a>[2]; </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;};</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="keyword">extern</span> <span class="keyword">const</span> <a class="code" href="structaicore__layertype.html">aicore_layertype_t</a> *<a class="code" href="ailayer__reshape_8h.html#a856728d528312aba1ac0cab7d06648cb">ailayer_reshape_type</a>;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="ailayer__reshape_8h.html#aeb527e440dcd5b5592ab43e6a5492783">  102</a></span>&#160;<a class="code" href="structailayer.html">ailayer_t</a> *<a class="code" href="ailayer__reshape_8h.html#aeb527e440dcd5b5592ab43e6a5492783">ailayer_reshape</a>(<a class="code" href="structailayer__reshape.html">ailayer_reshape_t</a> *layer, <a class="code" href="structailayer.html">ailayer_t</a> *input_layer);</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="ailayer__reshape_8h.html#a984364ffe0d6fea50802ee1ceed99890">  119</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__reshape_8h.html#a984364ffe0d6fea50802ee1ceed99890">ailayer_reshape_forward</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160; </div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="ailayer__reshape_8h.html#a875c3bf3489846feb4e29cabf5cbda27">  136</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__reshape_8h.html#a875c3bf3489846feb4e29cabf5cbda27">ailayer_reshape_backward</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160; </div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="ailayer__reshape_8h.html#a2fa15459be08483c10daf19274f8742b">  146</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__reshape_8h.html#a2fa15459be08483c10daf19274f8742b">ailayer_reshape_calc_result_shape</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160; </div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;<span class="preprocessor">#ifdef AIDEBUG_PRINT_MODULE_SPECS</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="ailayer__reshape_8h.html#afbb729cf037896c37aa3613f1003240e">  153</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__reshape_8h.html#afbb729cf037896c37aa3613f1003240e">ailayer_reshape_print_specs</a>(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// AIDEBUG_PRINT_MODULE_SPECS</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160; </div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// AILAYER_RESHAPE_H</span></div>
<div class="ttc" id="aaifes__core_8h_html"><div class="ttname"><a href="aifes__core_8h.html">aifes_core.h</a></div><div class="ttdoc">AIfES 2 core interface.</div></div>
<div class="ttc" id="aailayer__reshape_8h_html_a2fa15459be08483c10daf19274f8742b"><div class="ttname"><a href="ailayer__reshape_8h.html#a2fa15459be08483c10daf19274f8742b">ailayer_reshape_calc_result_shape</a></div><div class="ttdeci">void ailayer_reshape_calc_result_shape(ailayer_t *self)</div><div class="ttdoc">Calculate the shape of the result tensor (ailayer.result)</div></div>
<div class="ttc" id="aailayer__reshape_8h_html_a856728d528312aba1ac0cab7d06648cb"><div class="ttname"><a href="ailayer__reshape_8h.html#a856728d528312aba1ac0cab7d06648cb">ailayer_reshape_type</a></div><div class="ttdeci">const aicore_layertype_t * ailayer_reshape_type</div><div class="ttdoc">Reshape layer type.</div></div>
<div class="ttc" id="aailayer__reshape_8h_html_a875c3bf3489846feb4e29cabf5cbda27"><div class="ttname"><a href="ailayer__reshape_8h.html#a875c3bf3489846feb4e29cabf5cbda27">ailayer_reshape_backward</a></div><div class="ttdeci">void ailayer_reshape_backward(ailayer_t *self)</div><div class="ttdoc">Calculate the backward pass for given Reshape layer.</div></div>
<div class="ttc" id="aailayer__reshape_8h_html_a984364ffe0d6fea50802ee1ceed99890"><div class="ttname"><a href="ailayer__reshape_8h.html#a984364ffe0d6fea50802ee1ceed99890">ailayer_reshape_forward</a></div><div class="ttdeci">void ailayer_reshape_forward(ailayer_t *self)</div><div class="ttdoc">Calculate the forward pass for given Reshape layer.</div></div>
<div class="ttc" id="aailayer__reshape_8h_html_aeb527e440dcd5b5592ab43e6a5492783"><div class="ttname"><a href="ailayer__reshape_8h.html#aeb527e440dcd5b5592ab43e6a5492783">ailayer_reshape</a></div><div class="ttdeci">ailayer_t * ailayer_reshape(ailayer_reshape_t *layer, ailayer_t *input_layer)</div><div class="ttdoc">Initialize and connect the given Reshape layer.</div></div>
<div class="ttc" id="aailayer__reshape_8h_html_afbb729cf037896c37aa3613f1003240e"><div class="ttname"><a href="ailayer__reshape_8h.html#afbb729cf037896c37aa3613f1003240e">ailayer_reshape_print_specs</a></div><div class="ttdeci">void ailayer_reshape_print_specs(const ailayer_t *self)</div><div class="ttdoc">Print the layer specification.</div></div>
<div class="ttc" id="astructaicore__layertype_html"><div class="ttname"><a href="structaicore__layertype.html">aicore_layertype</a></div><div class="ttdoc">Type indicator of the layer.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:82</div></div>
<div class="ttc" id="astructailayer__flatten_html"><div class="ttname"><a href="structailayer__flatten.html">ailayer_flatten</a></div><div class="ttdoc">Structure of the Flatten layer, based on the reshape layer .</div><div class="ttdef"><b>Definition:</b> ailayer_reshape.h:78</div></div>
<div class="ttc" id="astructailayer__flatten_html_abe8035011f4a1c3aacdc504dd4bef9f5"><div class="ttname"><a href="structailayer__flatten.html#abe8035011f4a1c3aacdc504dd4bef9f5">ailayer_flatten::base</a></div><div class="ttdeci">ailayer_reshape_t base</div><div class="ttdoc">Inherited field members from reshape layer struct.</div><div class="ttdef"><b>Definition:</b> ailayer_reshape.h:79</div></div>
<div class="ttc" id="astructailayer__flatten_html_ac1131c176885226411465ea77bd4b92d"><div class="ttname"><a href="structailayer__flatten.html#ac1131c176885226411465ea77bd4b92d">ailayer_flatten::output_shape</a></div><div class="ttdeci">uint16_t output_shape[2]</div><div class="ttdoc">Target 2D shape for flatten operation.</div><div class="ttdef"><b>Definition:</b> ailayer_reshape.h:81</div></div>
<div class="ttc" id="astructailayer__reshape_html"><div class="ttname"><a href="structailayer__reshape.html">ailayer_reshape</a></div><div class="ttdoc">General layer  structure.</div><div class="ttdef"><b>Definition:</b> ailayer_reshape.h:42</div></div>
<div class="ttc" id="astructailayer__reshape_html_a272c55c5384efcdef56c4a0d2f402f5f"><div class="ttname"><a href="structailayer__reshape.html#a272c55c5384efcdef56c4a0d2f402f5f">ailayer_reshape::infer_axis</a></div><div class="ttdeci">uint8_t infer_axis</div><div class="ttdoc">Specifies the axis that is inferred from the elements of the tensor and remaining axes (Set to zero i...</div><div class="ttdef"><b>Definition:</b> ailayer_reshape.h:52</div></div>
<div class="ttc" id="astructailayer__reshape_html_a9a1746c92a713417bac8ab78ee640532"><div class="ttname"><a href="structailayer__reshape.html#a9a1746c92a713417bac8ab78ee640532">ailayer_reshape::reshape</a></div><div class="ttdeci">void(* reshape)(const aitensor_t *x, aitensor_t *result)</div><div class="ttdoc">Optional math function: Reshape.</div><div class="ttdef"><b>Definition:</b> ailayer_reshape.h:69</div></div>
<div class="ttc" id="astructailayer__reshape_html_a9a409c01151b26b02e9529cc3e9bad4a"><div class="ttname"><a href="structailayer__reshape.html#a9a409c01151b26b02e9529cc3e9bad4a">ailayer_reshape::output_dim</a></div><div class="ttdeci">uint8_t output_dim</div><div class="ttdoc">Output dimension count (length of output shape array).</div><div class="ttdef"><b>Definition:</b> ailayer_reshape.h:51</div></div>
<div class="ttc" id="astructailayer__reshape_html_ab13782a46e3804246bf82a92955096b3"><div class="ttname"><a href="structailayer__reshape.html#ab13782a46e3804246bf82a92955096b3">ailayer_reshape::base</a></div><div class="ttdeci">ailayer_t base</div><div class="ttdoc">Inherited field members from general ailayer struct.</div><div class="ttdef"><b>Definition:</b> ailayer_reshape.h:43</div></div>
<div class="ttc" id="astructailayer__reshape_html_ad3f93dd235b148208b067167c3ec0722"><div class="ttname"><a href="structailayer__reshape.html#ad3f93dd235b148208b067167c3ec0722">ailayer_reshape::output_shape</a></div><div class="ttdeci">uint16_t * output_shape</div><div class="ttdoc">Target shape for reshape operation.</div><div class="ttdef"><b>Definition:</b> ailayer_reshape.h:53</div></div>
<div class="ttc" id="astructailayer_html"><div class="ttname"><a href="structailayer.html">ailayer</a></div><div class="ttdoc">AIfES layer interface.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:252</div></div>
<div class="ttc" id="astructaitensor_html"><div class="ttname"><a href="structaitensor.html">aitensor</a></div><div class="ttdoc">A tensor in AIfES.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:89</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_5233a5861230ad4bc52bfd822c86fe04.html">cnn</a></li><li class="navelem"><a class="el" href="dir_a5c91e9bbf64c4b6a24d0c0102e9d7da.html">base</a></li><li class="navelem"><a class="el" href="dir_115795935351339455fee6eae515097b.html">ailayer</a></li><li class="navelem"><a class="el" href="ailayer__reshape_8h.html">ailayer_reshape.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
